/*
 * @Descripttion:
 * @version:
 * @Author: sueRimn
 * @Date: 2020-11-09 16:38:02
 */
const COMPLEX_CODE = 'cross';
const ORDINARY_CODE = 'normal';

const WD_CODE = 'dimension';
const DL_CODE = 'measure';

const WD_TYPE = 'FIEWD';
const DL_TYPE = 'FIEDL';
declare const DragTypes: [ 'dimension', 'measure', 'both', 'date', 'quotaDate' ];

const CUSTOM_CODE = 'custom';
const FIRST_CODE = 'first';
const LAST_CODE = 'last';
const ALL_CODE = 'all';

// 度量聚合方式
const AGGREGATE_TYPES = {
	SUM: { value: 'SUM', label: '求和' },
	AVG: { value: 'AVG', label: '均值' },
	MAX: { value: 'MAX', label: '最大' },
	MIN: { value: 'MIN', label: '最小' },
	COUNT: { value: 'COUNT', label: '计数' },
	COUNT_DISTINCT: { value: 'COUNT_DISTINCT', label: '去重复' },
};

// 日期聚合方式
const DATE_AGGREGATE_TYPES = {
	NONE: { value: '', label: '无' },
	YEAR: { value: 'YEAR', label: '年' },
	YEAR_QUARTERLY: { value: 'YEAR_QUARTERLY', label: '年-季度' },
	YEAR_MONTH: { value: 'YEAR_MONTH', label: '年-月' },
	YEAR_WEEK: { value: 'YEAR_WEEK', label: '年-周(跨年)' },
	YEAR_WEEK_EVE: { value: 'YEAR_WEEK_EVE', label: '年-周(不跨年)' },
	YEAR_MONTH_DAY: { value: 'YEAR_MONTH_DAY', label: '年-月-日' },
	QUARTER: { value: 'QUARTER', label: '季度' },
	MONTH: { value: 'MONTH', label: '月' },
	WEEK: { value: 'WEEK', label: '周' },
	DAYOFWEEK: { value: 'DAYOFWEEK', label: '星期' },
	DAY: { value: 'DAY', label: '日' },
};

// 核心指标图日期聚合方式
const QUOTA_DATE_AGGREGATE_TYPES = {
	YEAR: { value: 'YEAR', label: '年' },
	YEAR_QUARTERLY: { value: 'YEAR_QUARTERLY', label: '年-季度' },
	YEAR_MONTH: { value: 'YEAR_MONTH', label: '年-月' },
	YEAR_MONTH_DAY: { value: 'YEAR_MONTH_DAY', label: '年-月-日' }
};

// 排序方式
const SORT_TYPES = {
	NONE: { value: '', label: '无' },
	DESC: { value: 'DESC', label: '降序' },
	ASC: { value: 'ASC', label: '升序' },
};

// 小数位数设置
const DECIMAL_PLACE_TYPES = {
	NONE: { value: '', label: '自动' },
	ZERO: { value: 0, label: '0位' },
	ONE: { value: 1, label: '1位' },
	TWO: { value: 2, label: '2位' },
	THREE: { value: 3, label: '3位' },
	FOUR: { value: 4, label: '4位' },
	FIVE: { value: 5, label: '5位' },
	SIX: { value: 6, label: '6位' },
};

// 数据格式
// 维度度量自带的设置，度量自带设置数据格式，转千、万、百万、千万、亿
// THOUSAND, TENTHOUSAND, MILLION, TENMILLION, BILLION
const DATA_UNIT_TYPES = {
	NONE: { value: '', label: '自动' },
	THOUSAND: { value: 'THOUSAND', label: '千' },
	TENTHOUSAND: { value: 'TENTHOUSAND', label: '万' },
	MILLION: { value: 'MILLION', label: '百万' },
	TENMILLION: { value: 'TENMILLION', label: '千万' },
	BILLION: { value: 'BILLION', label: '亿' }
};

// 日期类型
const DATE_TYPES = [ 'DATE', 'TIME', 'DATETIME', 'TIMESTAMP' ];
const DECIMAL_TYPES = [ 'DECIMAL', 'FLOAT', 'DOUBLE' ];
const INT_TYPES = [ 'INT', 'BIGINT', 'SMALLINT', 'MEDIUMINT', 'TINYINT' ];

// 需要过滤的图表类型
const NO_FILTER_TYPES = [ 'TEXT', 'SINGLECHOICE', 'MULTIPLECHOICE', 'DATARANGE', 'DATEPICKER', 'DATERANGEPICKER' ];

//	数据筛选字段-通配符
const WILDCARD = [
	{
		label: '包含',
		value: 'LIKE'
	},
	{
		label: '开头为',
		value: 'LIKE_PRE'
	},
	{
		label: '结尾为',
		value: 'LIKE_END'
	},
	{
		label: '精确匹配',
		value: 'EQ'
	},
	{
		label: '不包含',
		value: 'NOT_LIKE'
	},
	{
		label: '不为空',
		value: 'IS_NOT'
	}
];

//	数据筛选字段-日期类型-数据聚合方式
const FILTER_DATE_TYPE = [
	{
		label: '年（格式：2020）',
		value: 'YEAR'
	},
	{
		label: '年-季度（格式：2020-1）',
		value: 'YEAR_QUARTERLY'
	},
	{
		label: '年-月（格式：2020-1）',
		value: 'YEAR_MONTH'
	},
	{
		label: '年-月-日（格式：2020-10-1）',
		value: 'YEAR_MONTH_DAY'
	},
	{
		label: '季度（格式：1）',
		value: 'QUARTER'
	},
	{
		label: '月（格式：1）',
		value: 'MONTH'
	}, {
		label: '日（格式：1）',
		value: 'DAY'
	}
];

//	数据筛选字段-度量类型-数据聚合方式
const FILTER_MEASURE_TYPE = [
	{
		label: '汇总',
		value: 'SUM'
	},
	{
		label: '均值',
		value: 'AVG'
	},
	{
		label: '计数',
		value: 'COUNT'
	}
];

//	数据筛选字段-度量类型-筛选条件
const FILTER_MEASURE_CONDITION = [
	{
		label: '等于',
		value: 'EQ'
	},
	{
		label: '大于',
		value: 'GT'
	},
	{
		label: '小于',
		value: 'LT'
	}
];

//	可以图表联动的图表类型
export const CHARTS_CHAIN_TYPE = [ 'SimpleTable', 'CrossTable', 'Liquid', 'Quota', 'Pie', 'Circle', 'Gauge', 'Line', 'DoubleYLine', 'Column',
	'ColumnLine', 'StackedColumn', 'WordCloud', 'Scatter', 'RadarChart', 'Area', 'MapFill', 'MapBubble', 'Bullet' ];

export const THEME_COLOR = [ '#167DDC', '#97CE32', '#FFBB22', '#0DD0D9', '#0CCC98', '#5B8FF9', '#CDDDFD', '#5AD8A6', '#CDF3E4', '#5D7092', '#CED4DE', '#F6BD16', '#FCEBB9', '#6F5EF9',
	'#D3CEFD', '#6DC8EC', '#D3EEF9', '#945FB9', '#DECFEA', '#FF9845', '#FFE0C7', '#1E9493', '#BBDEDE', '#FF99C3', '#FFE0ED', '#FFBB22' ];

export {
	COMPLEX_CODE,
	ORDINARY_CODE,
	WD_CODE,
	DL_CODE,
	WD_TYPE,
	DL_TYPE,
	DragTypes,
	CUSTOM_CODE,
	FIRST_CODE,
	LAST_CODE,
	ALL_CODE,
	AGGREGATE_TYPES,
	DATE_AGGREGATE_TYPES,
	SORT_TYPES,
	DATE_TYPES,
	DECIMAL_PLACE_TYPES,
	DECIMAL_TYPES,
	QUOTA_DATE_AGGREGATE_TYPES,
	NO_FILTER_TYPES,
	WILDCARD,
	DATA_UNIT_TYPES,
	FILTER_DATE_TYPE,
	FILTER_MEASURE_TYPE,
	FILTER_MEASURE_CONDITION,
	INT_TYPES
};
